<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="/fuman/js/oversea.js"></script>
<script>
function addorder()
{
	$('#addstorageform').modal('show');	
}

function getshopName()
{
	var platformID = $("#platformID").val();
	
	if(platformID)
	{
		 $.post("/orderlist/ajaxbutton", {"op": "getshoplist", "platformID": platformID},
		 function (data) {
			 if(data)
			 {
				 var tmp="<option value=''>店铺</option>";
				 for (var i = 0; i < data.length; i++) {
                    tmp += '<option value='+data[i].id+'>'+data[i].name+'</option>'
					
                }
				$("#shopname").html(tmp);
			 }
		}, "json");
	}
}
</script>
<title>退款报表</title>
<style type="text/css">
.stdtable tbody tr td{padding:3px 5px;}
</style>
<body class="withvernav">
{{include file='/public/leftmenu.tpl'}}
    <div class="pageheader notab">
      <h1 class="pagetitle">直发退款报表</h1>
      <span class="pagedesc"></span>
       <div class="menulist">
		&nbsp;
      </div>
    </div>
    <!--pageheader-->
    
    <div id="contentwrapper" class="contentwrapper">
      <div id="basicform" class="subcontent">
          <!--搜索栏-->
           
<form class="stdform stdform2" method="get" action="/report/orderRefund">
    <div style="" class="tableoptions">
    	<input type="hidden" name="op" id="op" value="saleCounts">
        <input type="hidden" name="program_id" value="{{$program.id}}" />
      <div style="line-height:28px;">
      <select name="timetype" id="timetype" class="selection" style="width:100px;" >
        <option value="1" {{if $timetype==1}} selected{{/if}}>订单时间</option>
        <option value="2" {{if $timetype==2}} selected{{/if}}>退款时间</option>
      </select>：<input type="text"  name="starttime" value="{{$starttime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" /> - <input type="text"  name="endtime" value="{{$endtime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" />
<span id="search_list">{{$shopname|getstr:35}}</span>
<input name="shopname" id="shopname" type="hidden" value="{{$shopname}}" />
<span id="choose_shop_btn" style="border:1px solid #ccc;padding:6px 5px 7px;border-radius:3px;cursor:pointer;" onClick="getShopList()">选择店铺 <img src="/fuman/images/search_down.png" width="14" height="21" align="absmiddle" style="margin-bottom:-4px;"></span>
      <!-- 
    <select name="orderdata" class="selection" style="width:100px;">
        <option value=""  selected>-排序方式-</option>
        <option value="1" {{if $orderdata==1}} selected{{/if}}>按占比降序</option>
        <option value="2" {{if $orderdata==2}} selected{{/if}}>按退款笔数</option>
    </select>
		 <select name="platformID" id="platformID"  class="selection select2_group" style="width:100px;" onChange="getshopName()" >
        <option value="" >平台</option>
        {{foreach from=$platform item=li key=key}}
              <option value="{{$li.id}}" {{if $platformID==$li.id}} selected{{/if}}>{{$li.name}}</option>
        {{/foreach}}
        </select>
        <select name="shopID" id="shopname"  class="selection select2_group" style="width:150px;display:none" >
        <option value="" >店铺</option>
        {{foreach from=$d_shop item=li key=key}}
              <option value="{{$li.id}}" {{if $shopID==$li.id}} selected{{/if}}>{{$li.name}}</option>
        {{/foreach}}
        </select>-->
       <button class="btn btn_orange btn_search radius50">Search</button>
 </div>
    </div>
    </form>
    <!--搜索栏结束-->
<table cellpadding="0" cellspacing="0" border="0" class="stdtable">
<thead>
  <tr valign="top" style="height:20px">
<td colspan="5" style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">按店铺统计</td>
</tr>
<tr valign="top" style="height:20px">
  <td height="20"  style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">店铺</td>
  <td height="20" style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">退款笔数/占比</td>
  <td height="20" align="center" style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">退款金额/占比</td>
  <td height="20" align="center" style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">总交易笔数</td>
  <td height="20" align="center" style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">总交易金额</td>
  </tr>
</thead>

 {{foreach from=$shop_refundlist item=res key=key}}
<tr>
  <td  align="center">{{$res.shopname}}</td>
  <td  align="center">{{$res.order_num}}/{{$res.num_mod}}%</td>
  <td  align="center">{{$res.goods_amount_total}}/{{$res.amount_mod}}%</td>
  <td  align="center">{{$res.all_order_num}}</td>
  <td  align="center">{{$res.amount_total}}</td>
</tr>
{{/foreach}}
<tr>
{{if $searchdata neq 'nosearch'}}
<td class="head1" align="center"><B>合计</B></td>
<td class="head0" align="center"><font color="#FF0000"><B>{{$refund_num}}/{{$refund_num_mod}}%</B></font></td>
<td class="head0" align="center"><font color="#FF0000"><B>{{$refund_num_money}}/{{$refund_num_money_mod}}%</B></font></td>
<td class="head0" align="center"><font color="#FF0000"><B>{{$allsubtotal}}</B></font></td>
<td class="head1" align="center"><font color="#FF0000"><B>{{$allcosprice}}</B></font></td>
</tr>
{{/if}}
</table>          
</div></div>


<div id="contentwrapper" class="contentwrapper">
<table cellpadding="0" cellspacing="0" border="0" class="stdtable">
<thead>
  <tr valign="top" style="height:20px">
<td colspan="5" style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">按国家统计</td>
</tr>
<tr valign="top" style="height:20px">
  <td height="20"  style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">国家</td>
  <td height="20" style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">退款笔数/占比</td>
  <td height="20" align="center" style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">退款金额/占比</td>
  <td height="20" align="center" style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">总交易笔数</td>
  <td height="20" align="center" style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">总交易金额</td>
  </tr>
</thead>

{{foreach from=$country_refundlist item=res key=key}}
<tr>
  <td  align="center">{{$res.shopid}}({{$res.country}})</td>
  <td  align="center">{{$res.order_num}}/{{$res.num_mod}}%</td>
  <td  align="center">{{$res.goods_amount_total}}/{{$res.amount_mod}}%</td>
  <td  align="center">{{$res.all_order_num}}</td>
  <td  align="center">{{$res.amount_total}}</td>
   </tr>
{{/foreach}}
<tr>
{{if $searchdata neq 'nosearch'}}
<td class="head1" align="center"><B>合计</B></td>
<td class="head0" align="center"><font color="#FF0000"><B>{{$refund_num1}}/{{$refund_num_mod1}}%</B></font></td>
<td class="head0" align="center"><font color="#FF0000"><B>{{$refund_num_money1}}/{{$refund_num_money_mod1}}%</B></font></td>
<td class="head0" align="center"><font color="#FF0000"><B>{{$allsubtotal1}}</B></font></td>
<td class="head1" align="center"><font color="#FF0000"><B>{{$allcosprice1}}</B></font></td>
</tr>
{{/if}}
</table>
</div>

<div id="contentwrapper" class="contentwrapper">
<table cellpadding="0" cellspacing="0" border="0" class="stdtable">
<thead>
  <tr valign="top" style="height:20px">
<td colspan="5" style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">按退款分析统计</td>
</tr>
<tr valign="top" style="height:20px">
  <td height="20" bgcolor="#CCCCCC" align="center" style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">退款分析</td>
  <td height="20" bgcolor="#CCCCCC" align="center" style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">退款笔数/占比</td>
  <td height="20" bgcolor="#CCCCCC" align="center" style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">退款金额/占比</td>
  <td height="20" bgcolor="#CCCCCC" align="center" style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">总退款笔数</td>
  <td height="20" bgcolor="#CCCCCC" align="center" style=" vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000; text-align: center;">总退款金额</td>
  </tr>
</thead>

{{foreach from=$question_refundlist item=res key=key}}
<tr>
  <td  align="center">{{$res.refund_reason}}</td>
  <td  align="center">{{$res.order_num}}/{{$res.num_mod}}%</td>
  <td  align="center">{{$res.goods_amount_total}}/{{$res.amount_mod}}%</td>
  <td  align="center">{{$refund_num}}</td>
  <td  align="center">{{$refund_num_money}}</td>
   </tr>
{{/foreach}}
<tr>
</table>
</div>
<div style="position:absolute;z-index:999;top:105px;border:1px solid #666;left:220px;width:870px;background:#f5f5f5;padding:6px 10px;height:450px;margin-bottom:40px;display:none;" id="ajax_box">
    <div style="padding-top:8px;padding-left:12px;height:28px;"><h4 style="float:left">选择要搜索的店铺</h4><span style="float:right">
      <input type="button" name="button" id="button" onClick="setShopInfo()" value="确定选择">&nbsp;&nbsp;
      <input type="button" value="关闭弹层" onClick="closeShowBox()">
    </span></div>
    <hr>
    <div id="shop_box" style="height:400px;overflow:auto"></div>
</div>
<script type="text/javascript" src="/fuman/js/report.js"></script>
<script language="javascript">
	function ajaxPostAddProduct(){/*
		var skuval=$("#sku").val();
		var program_idval=$("#program_id").val();
		$.post("/sales/addProgramProducts",{sku:skuval,program_id:program_idval},function(ret){
			alert(ret);
			if(ret.state==1){
			}else{
				alert(ret.msg);
			}
		},'html');(*/
		$("#attributeform").submit();
	}
	$(document).ready(function(){
		getshopName();
	})
</script>

</body>
</html>